/*
 * Message.cpp
 *
 *  Created on: Jun 17, 2009
 *      Author: edan
 */
#include <stdio.h>
#include <stdlib.h>
#include "Message.h"

Message::Message()
{
}

//TODO: maybe add original sender and final reciever

//RT message
Message::Message(int sender, int receiver, RT* rt)
{
	_sender = sender;
	_receiver = receiver;
	_type = "rt";
	_rt_Msg = rt;
}

// system_call message
Message::Message(int sender, int receiver, System_Message* msg)
{
	_sender = sender;
	_receiver = receiver;
	_type = "system";
	_rt_Msg = NULL;
	_system_Msg = msg;
}

Message::Message(int sender, RT* rt)
{
	_sender = sender;
	_type = "rt";
	_rt_Msg = rt;
}

void Message::setReceiver(int id)
{
	_receiver = id;
}

Message::~Message()
{
}

int Message::getSender()
{
	return _sender;
}

int Message::getReceiver()
{
	return _receiver;
}


string Message::getMsgType()
{
	return _type;
}

RT* Message::getRtMsg()
{
	return _rt_Msg;
}

System_Message* Message::getSysMsg()
{
	return _system_Msg;
}
